package gov.nist.ssd.swqb.core.search;

import static gov.nist.ssd.swqb.util.Static.concat;

import com.hp.hpl.jena.rdf.model.Model;
import com.hp.hpl.jena.rdf.model.RDFNode;

class UriNodeExactSearch extends AbstractAskSearch{

  private String nodeUri;
  
  public UriNodeExactSearch(ExactMatchText searchText, Model model, int resSize) {
    super(searchText,
          model,
          resSize,
          varName("x"),
          searchPattern(
            concat(
              "ASK {",
              "  {<%1$s> ?a ?b .}",
              "  UNION",
              "  {?a ?b <%1$s> .}",
              "}"
             )
          )
        );
    
    this.nodeUri = searchText.toString();
  }

  @Override
  public RDFNode getNode() {
    return getModel().getResource(nodeUri);
  }


}
